<?php
	function isLogin(){
		session_start();
		if(isset($_SESSION["loginStatus"]) && $_SESSION["loginStatus"] == true){
			return true;
		}else{
			session_destroy();
			return false;
		}
	}
	function sessionStart($userId , $userName){
		session_start();
		$_SESSION["loginStatus"] = true;
		$_SESSION["userId"] = $userId;
		$_SESSION["userName"] = $userName;
	}
	function sessionEnd(){
		session_start();
		unset($_SESSION["loginStatus"]);
		unset($_SESSION["userId"]);
		unset($_SESSION["userName"]);
		session_destroy();
		showmsg('logout successfully');
	}
?>